function PLUGIN:Initialize() 

end

-- Shameless copypasta
local function RemoveEntity(ent)
	if (ent:IsValid()) then
		ent:Remove()
	end
end

local function DoRemoveEntity(Entity)
	if CLIENT then return end
	
	constraint.RemoveAll(Entity)
	timer.Simple(1, RemoveEntity, Entity)
	
	Entity:SetNotSolid(true)
	Entity:SetMoveType(MOVETYPE_NONE)
	Entity:SetNoDraw(true)
	
	return true
end

-- Remove entities
function PLUGIN:killEnts(ply, args)
	if CLIENT then return end
	
	local ent = ply:GetEyeTraceNoCursor().Entity
	
	if ecs.Selections[ply] then
		for k, ent in pairs(ecs.Selections[ply]) do
			DoRemoveEntity(ent)
		end
	end
	if ecs.CanManipulate(ply, ent) then
		DoRemoveEntity(ent)
	end
end
PLUGIN:AddServerCommand( "kill" , PLUGIN.killEnts )